<?php

namespace app\models\task;

use app\models\Images;
use Yii;

/**
 * This is the model class for table "task_image".
 *
 * @property int $id
 * @property int $task_id
 * @property int $task_list_id
 * @property int $image_id
 */
class TaskImage extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'task_image';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['task_id', 'task_list_id', 'image_id'], 'integer'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'task_id' => 'Task ID',
            'task_list_id' => 'Task List ID',
            'image_id' => 'Image ID',
        ];
    }

    public function getImage()
    {
        return $this->hasOne(Images::class, ['id' => 'image_id']);
    }
}
